
import org.apache.commons.beanutils.PropertyUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;

@Service
public class 'TmsStoreGroup'ServiceImpl implements 'TmsStoreGroup'Service  {

    @Resource
    private 'TmsStoreGroup'Mapper 'tmsStoreGroup'Mapper;

    /**
     * 获取 'TmsStoreGroup' 分页列表
     */
    @Transactional
    public IPage get'TmsStoreGroup'Pagination( PaginationVo paginationVo, 'TmsStoreGroup'Query 'tmsStoreGroup'Query ) throws Exception {

        IPage page = new Page( paginationVo.getPageIndex(), paginationVo.getPageSize() );
        LambdaQueryWrapper<'TmsStoreGroup'Entity> lqs = new LambdaQueryWrapper();
        'tmsStoreGroup'Mapper.selectPage(page, lqs);

        List<'TmsStoreGroup'Entity> record = page.getRecords();
        if( !ObjectUtil.isNotEmptyList(record)){
            return page;
        }
        return null;
    }


    /**
     * 获取 'TmsStoreGroup' 所有数据
     *
    */
    @Transactional
    public List<'TmsStoreGroup'Entity> get'TmsStoreGroup'AllList( 'TmsStoreGroup'Query 'tmsStoreGroup'Query ) throws Exception {

        LambdaQueryWrapper<'TmsStoreGroup'Entity> lqs = new LambdaQueryWrapper();
        List<'TmsStoreGroup'Entity> list = 'tmsStoreGroup'Mapper.selectList(lqs);
        return list;
    }


    /**
     * 获取 'TmsStoreGroup' 详情
    */
    @Transactional
    public 'TmsStoreGroup'Entity get'TmsStoreGroup'Detail( Long id) throws Exception {

        'TmsStoreGroup'Entity 'tmsStoreGroup' = 'tmsStoreGroup'Mapper.selectById(id);
        return 'tmsStoreGroup';
    }


    /**
     * 新增 'TmsStoreGroup'
     * */
    @Transactional
    public void add'TmsStoreGroup'('TmsStoreGroup'Vo 'tmsStoreGroup'Vo) throws Exception {

        'TmsStoreGroup'Entity 'tmsStoreGroup' = new 'TmsStoreGroup'Entity();
        ReflectionCopy.copyProperties( 'tmsStoreGroup', 'tmsStoreGroup'Vo );
        'tmsStoreGroup'Mapper.insert('tmsStoreGroup');
        return;
    }


    /**
     * 更新 'TmsStoreGroup'
     * */
    @Transactional
    public void update'TmsStoreGroup'( 'TmsStoreGroup'Vo 'tmsStoreGroup'Vo) throws Exception {

        if( 'tmsStoreGroup'Vo.getId() == null ){
            throw GlobalException.gen(10021, "id不存在");
        }
        'TmsStoreGroup'Entity 'tmsStoreGroup' = new 'TmsStoreGroup'Entity();
        ReflectionCopy.copyProperties( 'tmsStoreGroup', 'tmsStoreGroup'Vo );
        'tmsStoreGroup'Mapper.updateById('tmsStoreGroup');
        return;
    }

    /**
     * 删除 'TmsStoreGroup'
     * */
    @Transactional
    public void batchRemove'TmsStoreGroup'( List<Long> ids ) throws Exception {


        if( !ObjectUtil.isNotEmptyList(ids) ){
            throw GlobalException.gen(10011, "要删除的id不存在");
        }
        'tmsStoreGroup'Mapper.deleteBatchIds(ids);
    }

}

      